﻿<%@ Page Language="C#" AutoEventWireup="true" EnableViewState="false" CodeBehind="QuestionManage.aspx.cs" Inherits="ProjectSemIII.Administrator.Survey.QuestionManage" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <link href="../../App_Themes/Administrator/css/styles.css" rel="stylesheet" />
    <title></title>
    <script type="text/javascript">
        function GetDynamicTextBox(value) {
            return '<input name="DynamicTextBox" style="width:80%" type="text" value="' + value + '" />&nbsp&nbsp&nbsp' +
                    '<input type="button" class="buttonS bLightBlue" value="Remove" onclick = "RemoveTextBox(this)" /><br /><br />'
        }
        function AddTextBox(text) {
            var div = document.createElement('DIV');
            div.innerHTML = GetDynamicTextBox(text);
            document.getElementById("TextBoxContainer").appendChild(div);
        }

        function RemoveTextBox(div) {
            document.getElementById("TextBoxContainer").removeChild(div.parentNode);
        }

        function RecreateDynamicTextboxes() {
            var values = eval('<%=Values%>');
            if (values != null) {
                var html = "";
                for (var i = 0; i < values.length; i++) {
                    html += "<div>" + GetDynamicTextBox(values[i]) + "</div>";
                }
                document.getElementById("TextBoxContainer").innerHTML = html;
            }
        }
        window.onload = RecreateDynamicTextboxes;
    </script>
</head>
<body>
    <div class="pagination">
        <asp:Label Text="Error dfgserfg jdksgbjksdb fjrkwb fvkjs bdjvkr t" runat="server" ID="lbError"></asp:Label>
    </div>
    <div class="fluid">
        <form id="validate1" runat="server" class="main">
            <fieldset>
                <div class="widget">
                    <div class="whead">
                        <h6 runat="server" id="lbQuestionNumber">Question Number One</h6>
                        <div class="clear"></div>
                    </div>
                    <div class="formRow">
                        <div class="grid3">
                            <label>Answers Type:<span class="req">*</span></label>
                        </div>
                        <div class="grid9">
                            <div class="floatL mr10">
                                <asp:RadioButton ID="rbRadio" AutoPostBack="true" OnCheckedChanged="rbRadio_CheckedChanged" runat="server" Text="RadioButton" GroupName="QuestionGroup" />
                            </div>
                            <div class="floatL mr10">
                                <asp:RadioButton ID="rbCheckBox" AutoPostBack="true" OnCheckedChanged="rbCheckBox_CheckedChanged" runat="server" Text="CheckBox" GroupName="QuestionGroup" />
                            </div>
                            <div class="floatL mr10">
                                <asp:RadioButton ID="rbComment" AutoPostBack="true" OnCheckedChanged="rbComment_CheckedChanged" runat="server" Text="Comment" GroupName="QuestionGroup" />
                            </div>
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formRow">
                        <div class="grid3">
                            <label>Question Detail:<span class="req">*</span></label>
                        </div>
                        <div class="grid9">
                            <CKEditor:CKEditorControl ID="txtQuestion" BasePath="~/ckeditor" runat="server"></CKEditor:CKEditorControl>
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formRow" id="answerForm" runat="server">
                        <div class="grid3">
                            <label>Answers Detail:</label><input id="btnAdd" type="button" class="buttonS bLightBlue" value="New Answer" onclick="AddTextBox('')" />
                        </div>
                        <div class="grid9">
                            <div id="TextBoxContainer" runat="server"></div>
                        </div>
                        <div class="clear"></div>
                    </div>
                    <div class="formRow">
                        <div class="grid3">
                            <label><span class="req"></span></label>
                        </div>
                        <div class="grid9">
                            <div>
                                <div style="float: left; margin-left: 100px">
                                    <asp:Button ID="btSubmit" OnClick="btSubmit_Click" Text="Submit" runat="server" CssClass="buttonS bLightBlue" />
                                </div>
                            </div>
                        </div>
                        <div class="clear"></div>
                    </div>
                </div>
            </fieldset>
        </form>
    </div>
    <div class="divider"><span></span></div>
</body>
</html>
